﻿using AnjLab.SyncIT.Core.Api;
using Microsoft.Office.Interop.Outlook;

namespace AnjLab.SyncIT.Core.Data.Outlook.TaskList
{
    public class OutlookTasksFolder: OutlookFolder
    {
        public OutlookTasksFolder()
            : base(OlDefaultFolders.olFolderTasks)
        {
        }

        public override OutlookDestination OutlookDestination
        {
            get { return Api.OutlookDestination.TaskList; }
        }

        protected override IOutlookItem GetItem(object comSourceObject, string itemId)
        {
            return new OutlookTaskItem ((TaskItem) comSourceObject) {ItemID = itemId};
        }

        public override IOutlookItem CreateNewItem()
        {
            return GetItem(ParentFolder.Items.Add(OlItemType.olTaskItem), string.Empty);
        }
    }
}